package com.cy.ppj.comm.constant;

import com.cy.ppj.comm.properties.OssProperties;
import com.cy.ppj.comm.properties.SystemProperties;
import com.cy.ppj.comm.utils.SpringContextUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @description: 常量
 * @author: Ocean
 * @create: 2018-07-23 15:36
 **/
public class Constants {

    public static final Boolean IS_PROD;

    public static final String SLAT;

    public static final String FILE_PTAH;
    
    public static final String FULL_FILE_PTAH;
    
    public static final String MALL_BUCKET_NAME;

    public static final String PROFILES_ACTIVE;

    public static final Long JYD_PRODUCTID;

    static {
        SystemProperties systemProperties = SpringContextUtils.getBean(SystemProperties.class);
        IS_PROD = systemProperties.getIsProd();
        SLAT = systemProperties.getSalt();
        PROFILES_ACTIVE = systemProperties.getProfilesActive();
        JYD_PRODUCTID = Long.parseLong(systemProperties.getJydProductId());

        FILE_PTAH = SpringContextUtils.getBean(OssProperties.class).getBucketName();
        FULL_FILE_PTAH = SpringContextUtils.getBean(OssProperties.class).getFullBucketName();
        MALL_BUCKET_NAME = SpringContextUtils.getBean(OssProperties.class).getMallBucketName();
    }

    public static final Long ADMININTRATOR = 1L;

    public static final String ASYNC = "asyncExecutor";

    public static final Integer LOGIN_TIME = 6;

    public static final TimeUnit LOGIN_TIME_UNIT = TimeUnit.HOURS;

    public static final String USER_LOGIN_KEY = "USER-LOGIN:";

    public static final String ADMIN_LOGIN_KEY = "ADMIN-LOGIN:";

    public static final String TOKEN = "token";
    
    /** 审核员角色ID，固定 = 2 */
    public static final Long AUDIT_ROLE_ID = 2L;

    public static final String SMS_CODE = "SMS-CODE:";

    public static final String yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss";
    
    /** 用户初始密码：chaoyue2018 */
    public static final String USER_INIT_PASSWORD = "chaoyue2018";

    public static final String WETCHAT_TEMPLATE_CHAT = "wechatTemplateChat";
    
    public static final String yyyyMMddHHmmssSSS = "yyyyMMddHHmmssSSS";
    
    public static final String CUSTOMER_SOURCE_PPJ = "匹配家";
    
    public static final String CUSTOMER_SOURCE_FACE_SIGNATURE = "面签新增";
    
    public static final String CUSTOMER_SOURCE_BANKMA_MALL = "马先生商城";

    /** 上传最大文件大小   */
    public static final Long MAX_FILE_SIZE = 20 * 1024 * 1024L;

    public static final Long MAX_FILE_SIZE_MB = 20L;

}
